package com.briup.jz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.briup.jz.bean.Platform;
import com.briup.jz.bean.PlatformExample;
import com.briup.jz.dao.PlatformMapper;
import com.briup.jz.service.IPlatformService;
@Service
public class PlatformServiceImpl implements IPlatformService{
	@Autowired
		private PlatformMapper platform;
	@Override
	public List<Platform> findAll() {
		// TODO Auto-generated method stub
		return platform.selectByExample(new PlatformExample());
	}

	@Override
	public void saveOrUdate(Platform c1) {
		// TODO Auto-generated method stub
		if(c1.getId()==null) {
			platform.updateByExample(c1, new PlatformExample());
		}else {
			platform.insert(c1);
		}
	}

	@Override
	public Platform findById(Long id) {
		// TODO Auto-generated method stub
		return platform.selectByPrimaryKey(id);
	}

	@Override
	public void delete(Long id) {
		// TODO Auto-generated method stub
		platform.deleteByPrimaryKey(id);
	}

}
